using System;
using System.Collections;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;

namespace Jungle.Code.BLL
{
	public abstract class BaseTemplate : UserControl
	{
		// Constructors
		protected BaseTemplate() {
		}

		// Properties
		public string Title {
			get {
				return this._title.Text;
			}
			set {
				this._title.Text = value;
			}
		}

        public string Keywords
        {
            set
            {
                _keywords.Text = "<meta name=\"keywords\" content=\"" + value + "\">";
            }
        }

        public string Description
        {
            set
            {
                _description.Text = "<meta name=\"description\" content=\"" + value + "\"/>";
            }
        }

		public string Css {
			get {
				return this._css.Attributes["href"];
			}
			set {
				this._css.Attributes.Add("href", this.Page.ResolveUrl(value));
			}
		}

		public Control Form {
			get {
				foreach (Control control1 in this.Controls) {
					if (control1 is HtmlForm) {
						return control1 as HtmlForm;
					}
				}
				return null;
			}
		}

		public Hashtable Containers {
			get {
				Hashtable hashtable1 = new Hashtable();
				foreach (Control value in this.Form.Controls) {
					if (value is PlaceHolder) {
						hashtable1.Add(value.ID, value);
					}
				}
				return hashtable1;
			}
		}


		// Instance Fields
		protected Literal _title;
        protected Literal _keywords;
        protected Literal _description;
		protected HtmlGenericControl _css;
	}
}
